package com.interest.controller.api;

import com.alibaba.fastjson.JSONObject;
import com.interest.base.entity.ModelBean;
import com.interest.modules.zen.entity.Zen;
import com.interest.modules.zen.service.ZenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by yangfeng on 16-11-9.
 */
@Controller
@RequestMapping("/api/zen")
public class ApiZenController {
    @Autowired
    private ZenService zenService;

    @RequestMapping("/get")
    //@Authorization
    @ResponseBody
    public ModelBean getList() {
        Zen zen = zenService.getZen();
        JSONObject data = new JSONObject();
        data.put("result", zen.getContent());
        return new ModelBean(data);
    }
}
